//
//  GKZYMajorDetailTableViewCell.m
//  GKZYAid
//
//  Created by tony on 16/3/5.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "GKZYMajorDetailTableViewCell.h"
#import "MyDefine.h"

@implementation GKZYMajorDetailTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    }
    return self;
}


-(void)configureTheCellWithModel:(GKZYSimilarMajorModel *)model{

    CALayer *hTopBorder = [CALayer layer];
    hTopBorder.backgroundColor = [[UIColor colorWithRed:240/256.0 green:240/256.0 blue:240/256.0 alpha:1]CGColor];
    hTopBorder.frame = CGRectMake(-0.5, -0.5, KmainScreenBoundsWidth+1-20, 0.5);
    
    CALayer *vLeftBorder = [CALayer layer];
    vLeftBorder.frame = CGRectMake(-0.5, -0.5, 0.5, 40+1);
    vLeftBorder.backgroundColor = [[UIColor colorWithRed:240/256.0 green:240/256.0 blue:240/256.0 alpha:1]CGColor];
    
    CALayer *hBottomBorder = [CALayer layer];
    hBottomBorder.backgroundColor = [[UIColor colorWithRed:240/256.0 green:240/256.0 blue:240/256.0 alpha:1]CGColor];
    hBottomBorder.frame = CGRectMake(-0.5, 40, KmainScreenBoundsWidth+1-20, 0.5);
    
    CALayer *vRightBorder = [CALayer layer];
    vRightBorder.frame = CGRectMake(KmainScreenBoundsWidth, -0.5, 0.5, 40+1);
    vRightBorder.backgroundColor = [[UIColor darkGrayColor]CGColor];

    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 0, KmainScreenBoundsWidth-20, 40)];
    view.layer.borderColor = [[UIColor colorWithRed:240/256.0 green:240/256.0 blue:240/256.0 alpha:1]CGColor];
    view.layer.borderWidth = 0.5f;
    [view.layer addSublayer:hTopBorder];
    [view.layer addSublayer:hBottomBorder];
    [view.layer addSublayer:vRightBorder];
    [view.layer addSublayer:vLeftBorder];
    [self addSubview:view];
    
    UILabel *majorLab = [[UILabel alloc]init];
    majorLab.textColor = [UIColor orangeColor];
    majorLab.text = model.major_name;
    majorLab.font = [UIFont systemFontOfSize:14];
    majorLab.frame = CGRectMake(5, 0, (KmainScreenBoundsWidth-20)/2-10, 40);
    [view addSubview:majorLab];
    
    UILabel *cateLab = [[UILabel alloc]init];
    cateLab.frame = CGRectMake(KmainScreenBoundsWidth/2-15, 0, KmainScreenBoundsWidth/2-10, 40);
    cateLab.font = [UIFont systemFontOfSize:14];
    NSString *string = [NSString stringWithFormat:@"%@  >",model.major_cate];
    cateLab.text = string;
    cateLab.textColor = DeepCustomGrayColor;
    cateLab.textAlignment = NSTextAlignmentRight;
    [view addSubview:cateLab];
    self.frame = view.frame;
}



@end
